'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 2_use_at_tool_create_tool.py
* @Time: 2025/11/1
* @All Rights Reserve By Brtc
'''
from langchain_core.tools import tool
from pydantic import BaseModel, Field
class CaculatorInput(BaseModel):
    a: int = Field(description="第一个数字")
    b: int = Field(description="第二个数字")

#@tool
#def multiply(a:int, b:int)->int:
 #   """传递两个参数相乘"""
 #   return a*b

@tool(description="一个很牛逼的工具", args_schema=CaculatorInput, return_direct=True)
def multiply(a:int, b:int)->int:
    return a * b

print("工具名字:", multiply.name)
print("工具描述:", multiply.description)
print("工具参数:", multiply.args)
print("是否直接返回:", multiply.return_direct)
print("直接调用:",multiply.invoke({"a":2,"b":3}))
